<?php
/**
 * --------------------------------------------------
 * Copyright © 2018 PHP游戏项目学习交流群：820621745 版权所有
 *
 * 功能描述：协议
 *
 * 创建标识：Created by Zyc On 2018/7/31 21:23
 *
 * 修改标识：
 * 修改描述：
 *---------------------------------------------------
 */

class ProtocolApi
{

    //----------------------------------------心跳------------------------------------------------
    public static $HEART                    = 0X100001;     //心跳
    public static $STATUS_ERROR             = 0X100002;     //错误状态
    public static $TOKEN_ERROR              = 0X100003;     //错误TOKEN
    public static $GAME_RECONNECT           = 0X100004;     //断线重连

    //----------------------------------------公共服务器事件--------------------------------------------
    public static $USER_LOGIN               = 0X200002;     //玩家登录
    public static $USER_REGISTER            = 0X200003;     //玩家注册

    //----------------------------------------游戏服务器事件--------------------------------------------
    public static $DDZ_GET_ROOM_LIST        = 0X300001;     //房间列表
    public static $DDZ_JOIN_ROOM            = 0X300002;     //加入房间
    public static $DDZ_GET_ROOM_DETAIL      = 0X300003;     //获取房间当前信息
    public static $DDZ_PLAYER_READY         = 0X300004;     //玩家准备
    public static $DDZ_PLAYER_UNREADY       = 0X300005;     //玩家取消准备

    /**
     * @param $head
     * @param $message
     * @return string
     */
    public static function returnMessage($head,$message){
        $msg=json_encode(['head'=>$head, 'msg'=>$message]);
        return $msg;
    }

}